/////////////////////////////////////////////////////////////////////////////////////
// Include Files
#include "Listener.h"
#include "Notification.h"

/////////////////////////////////////////////////////////////////////////////////////
// IListener Implementation
void IE::IListener::ProcessEvents()
{
	// process all notifications in the list, more may be added while looping
	m_NotificationMutex.Lock();
	for( uint_t i = 0; i < m_lstpNotifications.GetSize(); ++i )
	{
		ABCNotification *pNotification = m_lstpNotifications[i];
		m_NotificationMutex.Unlock();

		// process and then delete this notification
		pNotification->Process(this);
		delete pNotification;

		m_NotificationMutex.Lock();
	}

	// clear the list
	m_lstpNotifications.Clear();
	m_NotificationMutex.Unlock();
}
